home *** CD-ROM | disk | FTP | other *** search
- /* Definitions of target machine for GNU compiler. atariST/TT version.
- Copyright (C) 1987, 1988 Free Software Foundation, Inc.
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
- /* The following Macros control the compilation
- *
- * CROSSATARI defined when making cross compiler for TOS or Minix
- * MINIX defined when making cross compiler for MINIX only
- * atariminix defined when making compiler for MINIX
- * atarist defined when making compiler for TOS
- */
-
- #include "m68k.h"
-
- #if defined(__GNUC__)
- # if defined(alloca)
- # undef alloca
- # endif
- # define alloca(x) __builtin_alloca(x)
- #endif
-
- #if defined(sparc)
- # if !defined(alloca)
- # include <alloca.h>
- # endif
- #endif
-
- /* See tm-m68k.h. 0 means 68000 with no 68881. */
-
- #define TARGET_DEFAULT 0 /* use this for a regular ST */
- /* #define TARGET_DEFAULT 2 use this for a ST with 68881/82 */
- /* #define TARGET_DEFAULT 7 use this for a TT with 68881/82 */
- /* #define TARGET_DEFAULT 5 use this for a TT withOUT 68881/82 */
-
- /* These compiler options take an argument. We ignore -target for now. */
-
- #define WORD_SWITCH_TAKES_ARG(STR) \
- (!strcmp (STR, "Tdata") || !strcmp (STR, "include") \
- || !strcmp (STR, "imacros") || !strcmp (STR, "target") \
- || !strcmp (STR, "assert"))
-
- /* -m68020 requires special flags to the assembler. */
-
- /* -m68000 (on atari) need this flag to assembler, otherwise pc relative
- code is produced where it should not be (in places where the
- 68000 only allows data ALTERABLE addressing modes) (++jrb 03/19/89) */
- #if (TARGET_DEFAULT & 5)
- /* for the TT etc (020/030) */
- #define ASM_SPEC \
- "%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
- #else
- /* for a regular 68k ST */
- #define ASM_SPEC "%{m68020:-mc68020}%{mc68020:-mc68020} \
- %{!mc68020:%{!m68020:-mc68000}}"
- #endif
-
- /* Names to predefine in the preprocessor for this target machine. */
-
- #if (defined(MINIX) || defined(atariminix))
- # if (TARGET_DEFAULT & 5)
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k -DATARI_TT -DM68881"
- # else
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k -DATARI_TT"
- # endif
- # else
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k -DM68881"
- # else
- # define CPP_PREDEFINES "-DATARI_ST -Dminix -Dm68k"
- # endif
- # endif
- #else
- # if (TARGET_DEFAULT & 5)
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k -Dataritt -DM68881"
- # else
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k -Dataritt"
- # endif
- # else
- # if(TARGET_DEFAULT & 2)
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k -DM68881"
- # else
- # define CPP_PREDEFINES "-Datarist -Dgem -Dm68k"
- # endif
- # endif
- #endif
-
- #define PTRDIFF_TYPE "long int"
- #define SIZE_TYPE "long unsigned int"
- #undef WCHAR_TYPE
- #undef WCHAR_TYPE_SIZE
- #define WCHAR_TYPE "int"
- #define WCHAR_TYPE_SIZE 32 /* just for building the compiler */
-
- /* default exec dir */
- #ifndef STANDARD_EXEC_PREFIX
- #ifdef MINIX
- #define STANDARD_EXEC_PREFIX "/net/acae127/home/bammi/atari/cross-minix/lib/gcc-"
- #else
- #ifdef atariminix
- #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-"
- #else
- #define STANDARD_EXEC_PREFIX "/net/acae127/home/bammi/atari/cross-gcc/lib/gcc-"
- #endif
- #endif
- #endif
-
- #define STANDARD_STARTFILE_PREFIX ""
- #define EXECUTABLE_SUFFIX ".ttp"
-
- /* Alignment of field after `int : 0' in a structure. */
- /* recent gcc's have this as 16, this is left in for the benfit of */
- /* older gcc */
- #undef EMPTY_FIELD_BOUNDARY
- #define EMPTY_FIELD_BOUNDARY 16
-
- /* Every structure or union's size must be a multiple of 2 bytes. */
-
- #undef STRUCTURE_SIZE_BOUNDARY
- #define STRUCTURE_SIZE_BOUNDARY 16
-
- /* code seems to assume this... */
- #define DBX_DEBUGGING_INFO
-
- #ifndef HAVE_VPRINTF
- #define HAVE_VPRINTF 1
- #endif
-
- #ifdef abort
- #undef abort
- #define abort fancy_abort
- #endif
-
-
- /* the following stolen from tm-sun3.h, they seem to work better */
- /* This is how to output an assembler line defining a `double' constant. */
-
- /* fake out isinf for !sun for now */
- #ifndef sun
- #define isinf(X) (0)
- #endif
-
- #define double_is_minus_zero(X) ((X) == -0.0)
-
- #undef ASM_OUTPUT_DOUBLE
- #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "\t.double 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "\t.long 0x80000000,0\n") \
- : fprintf (FILE, "\t.double 0r%.20e\n", (VALUE)))
-
- /* This is how to output an assembler line defining a `float' constant. */
-
- #undef ASM_OUTPUT_FLOAT
- #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "\t.single 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "\t.long 0x80000000\n") \
- : fprintf (FILE, "\t.single 0r%.20e\n", (VALUE)))
-
- #undef ASM_OUTPUT_FLOAT_OPERAND
- #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "#0r-0.0") \
- : fprintf (FILE, "#0r%.9g", (VALUE)))
-
- #undef ASM_OUTPUT_DOUBLE_OPERAND
- #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
- (isinf ((VALUE)) \
- ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
- : double_is_minus_zero ((VALUE)) \
- ? fprintf (FILE, "#0r-0.0") \
- : fprintf (FILE, "#0r%.20g", (VALUE)))
-
-
- /* specs for start file and link specs */
-
- #ifndef CROSSATARI
-
- #ifdef atariminix
- #define STARTFILE_SPEC \
- "%{pg:/usr/local/lib/gcrtso.o%s}\
- %{!pg:\
- %{p:/usr/local/lib/mcrtso.o%s}\
- %{!p:/usr/local/lib/crtso.o%s}}"
- #else /* atarist */
- #define STARTFILE_SPEC \
- "%{mint:\
- %{pg:$GNULIB$\\mgcrt0.o%s}\
- %{!pg:\
- %{p:$GNULIB$\\mmcrt0.o%s}\
- %{!p:$GNULIB$\\mcrt0.o%s}}}\
- \
- %{!mint:\
- %{pg:$GNULIB$\\gcrt0.o%s}\
- %{!pg:\
- %{p:$GNULIB$\\mcrt0.o%s}\
- %{!p:$GNULIB$\\crt0.o%s}}}"
- #endif
-
- #else /* CROSSATARI */
-
- #ifdef MINIX
- #define STARTFILE_SPEC \
- "%{pg:/net/acae127/home/bammi/atari/cross-minix/lib/gcrtso.o%s}\
- %{!pg:\
- %{p:/net/acae127/home/bammi/atari/cross-minix/lib/mcrtso.o%s}\
- %{!p:/net/acae127/home/bammi/atari/cross-minix/lib/crtso.o%s}}"
- #else
- #define STARTFILE_SPEC \
- "%{mint:\
- %{pg:/net/acae127/home/bammi/atari/cross-gcc/lib/mgcrt0.o%s}\
- %{!pg:\
- %{p:/net/acae127/home/bammi/atari/cross-gcc/lib/mmcrt0.o%s}\
- %{!p:/net/acae127/home/bammi/atari/cross-gcc/lib/mcrt0.o%s}}}\
- \
- %{!mint:\
- %{pg:/net/acae127/home/bammi/atari/cross-gcc/lib/gcrt0.o%s}\
- %{!pg:\
- %{p:/net/acae127/home/bammi/atari/cross-gcc/lib/mcrt0.o%s}\
- %{!p:/net/acae127/home/bammi/atari/cross-gcc/lib/crt0.o%s}}}"
- #endif
- #endif /* CROSSATARI */
-
- #ifdef MINIX
- #define LIB_SPEC \
- "%{mshort:/net/acae127/home/bammi/atari/cross-minix/lib/libc.a}\
- %{!mshort:/net/acae127/home/bammi/atari/cross-minix/lib/libc32.a}"
- #else
- #ifdef atariminix
- #define LIB_SPEC \
- "%{mshort:/usr/local/lib/libc.a}\
- %{!mshort:/usr/local/lib/libc32.a}"
- #else /* atarist cross or native */
-
- #ifndef __GPLUSPLUS__
- #define LIB_SPEC \
- "%{mint:\
- %{!gg:\
- %{mshort:-lmint16 -lgnu16}\
- %{!mshort:-lmint -lgnu}}\
- %{gg:\
- %{mshort:-lmintg16 -lgnugdb16}\
- %{!mshort:-lmintg -lgnugdb}}}\
- \
- %{!mint:\
- %{!gg:\
- %{mshort:-lgnu16}\
- %{!mshort:-lgnu}}\
- %{gg:\
- %{mshort:-lgnugdb16}\
- %{!mshort:-lgnugdb}}}"
-
- #else /* atariSt g++ */
-
- #define LIB_SPEC \
- "%{mint:\
- %{!gg:\
- %{mshort:-lmint16 -lg++16 -lgnu16}\
- %{!mshort:-lmint -lg++ -lgnu}}\
- %{gg:\
- %{mshort:-lmintg16 -lg++gdb16 -lgnugdb16}\
- %{!mshort:-lmintg -lg++gdb -lgnugdb}}}\
- \
- %{!mint:\
- %{!gg:\
- %{mshort:-lg++16 -lgnu16}\
- %{!mshort:-lg++ -lgnu}}\
- %{gg:\
- %{mshort:-lg++gdb16 -lgnugdb16}\
- %{!mshort:-lg++gdb -lgnugdb}}}"
- #endif
-
- #endif
- #endif
-
- /* add -mint : meanining
- pre-procees with -D__MINT__
- compile with -mint (target_flags & 02000) (this flag is
- currently not used by cc1, but maybe later)
- link with mcrt0.o and -lmint -lgnu
-
- */
- #undef TARGET_SWITCHES
- #define TARGET_SWITCHES \
- { { "68020", 5}, \
- { "c68020", 5}, \
- { "68881", 2}, \
- { "bitfield", 4}, \
- { "68000", -5}, \
- { "c68000", -5}, \
- { "soft-float", -0102}, \
- { "nobitfield", -4}, \
- { "rtd", 8}, \
- { "nortd", -8}, \
- { "short", 040}, \
- { "noshort", -040}, \
- { "fpa", 0100}, \
- { "nofpa", -0100}, \
- { "sky", 0200}, \
- { "nosky", -0200}, \
- { "68040", 0407}, \
- { "68030", -01400}, \
- { "68030", 7}, \
- { "68040-only", 01000}, \
- { "int", 02000}, \
- { "noint", -02000}, \
- { "", TARGET_DEFAULT}}
-
- #ifdef atarist
- # ifdef ASM_OUTPUT_SOURCE_FILENAME
- # undef ASM_OUTPUT_SOURCE_FILENAME
- # endif
- # define ASM_OUTPUT_SOURCE_FILENAME(file, filename) \
- fprintf (file, "\t.stabs \""); \
- atari_output_filename(file, filename); \
- fprintf(file, "\",%d,0,0,Ltext\n", N_SOL)
- #endif
-
- /* these two should never be used, #define them here so they are'nt
- in cccp.c
- */
- #define STANDARD_INCLUDE_DIR 8086_sucks
- #define LOCAL_INCLUDE_DIR 80486_sucks
-
- /* all the INCLUDE_DEFAULTS */
- #ifdef CROSSATARI /* TOS or MINIX cross compiler */
- # define SYSTEM_INCLUDE_DIR CROSSINC
- # define SYSTEM_GPLUSPLUS_INCLUDE_DIR GPLUSPLUS_INCLUDE_DIR
- #endif
-
- #ifdef atarist /* TOS native compiler */
- # define SYSTEM_INCLUDE_DIR "\\gnu\\lib"
- # define SYSTEM_GPLUSPLUS_INCLUDE_DIR "\\gnu\\g++-inc"
- #endif
-
- #ifdef atariminix /* MINIX native compiler */
- # define SYSTEM_INCLUDE_DIR "/usr/local/gcc-include"
- # define SYSTEM_GPLUSPLUS_INCLUDE_DIR "/usr/local/g++-inc"
- #endif
-
- #define INCLUDE_DEFAULTS \
- { \
- { SYSTEM_INCLUDE_DIR, 0 }, \
- { SYSTEM_GPLUSPLUS_INCLUDE_DIR, 1 }, \
- { 0, 0 } \
- }
-
- #ifdef atarist
- void atari_output_filename();
- #endif
-
- #ifdef atarist
- #define FILE_NAME_NONDIRECTORY(X) \
- atari_filename_nondirectory(X);
- extern char *atari_filename_nondirectory();
- #endif
-